package mylab.io.base.model.impl;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import mylab.io.base.model.Endpoint;

import java.net.URI;

@Getter
@Setter
@ToString
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class UriEndpoint  implements Endpoint {
    String uri;

    public UriEndpoint() {
    }

    public UriEndpoint(String uri) {
        this.uri = uri;
    }

    public URI getURI(){
        return URI.create(uri);
    }

    @JsonIgnore
    @EqualsAndHashCode.Include
    @Override
    public String getId() {
        return uri;
    }
}
